package site.assad.aspectj.example;


import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;

/**
 * Author: Al-assad 余林颖
 * E-mail: yulinying_1994@outlook.com
 * Date: 2017/12/5 20:16
 * Description: @Around 环绕增强切面类
 */
@Aspect
public class AroundGreetingAspect {

    @Around("execution(* greetTo(..)) && target(site.assad.common.Waiter)")
    public Object aroundAspect(ProceedingJoinPoint pjp) throws Throwable {
        System.out.println("Hello!");      //before greetTo()
        Object retVal = pjp.proceed();     //连接点程序执行，并返回结果
        System.out.println("Goodbye!");    //after greetTo()

        return retVal;
    }

}
